package org.xteam.sled.semantic.exp;

public class ExpMod extends ExpFactor {

	public ExpMod(int modulo, Exp expr) {
		super(modulo, expr);
	}
	
	public int hashCode() {
		return expr.hashCode() + factor;
	}
	
	public boolean equals(Object o) {
		return (o instanceof ExpMod)
			&& ((ExpMod)o).factor == factor
			&& ((ExpMod)o).expr.equals(expr);
	}
	
	@Override
	public void visit(IExpVisitor visitor) {
		visitor.visitMod(this);
	}
	
	public String toString() {
		return "(" + expr + "%" + factor + ")";
	}

}
